package org.yoshiori.lingr.api.vo;

/**
 * @author yoshiori
 * 
 */
public enum Source {
	BROWSER("browser"), 
	API("api");

	private String sourceName;

	/**
	 * @param sourceName
	 */
	private Source(String sourceName) {
		this.sourceName = sourceName;
	}

	/**
	 * @param type
	 * @return
	 */
	public static Source lookup(String type) {
		for (Source source : values()) {
			if (source.toString().equals(type)) {
				return source;
			}
		}
		return null;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Enum#toString()
	 */
	@Override
	public String toString() {
		return sourceName;
	}
}
